import request from "@/utils/request.js";

/**
 * 查询用户统计信息
 *
 * 本函数通过发送GET请求到'/admin/statistics/user'端点，获取用户相关的统计信息
 * 无需参数
 *
 * @returns {Promise} 返回一个Promise对象，包含请求结果
 */
export const queryUserStatistics = (data) => {
  return request.post('/admin/analysis/user', data)
}

/**
 * 查询登录统计信息
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const queryLoginStatistics = (data) => {
  return request.post('/admin/analysis/login', data)
}

/**
 * 查询在线用户数量
 */
export const queryOnlineUserCount = () => {
  return request.get('/admin/analysis/online')
}

/**
 * 查询图片资源统计信息
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const queryPicResourceStatistics = () => {
  return request.get('/admin/analysis/pic')
}

/**
 * 查询图片资源分析信息
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const queryPicResourceAnalysis = (data) => {
  return request.post('/admin/analysis/pic', data)
}

export const queryPv = () => {
  return request.get('/admin/analysis/pv')
}

export const queryUv = () => {
  return request.get('/admin/analysis/uv')
}
